package main

import (
	"io"
	"io/ioutil"
	"net/http"
	//"net/http/httputil"
	"log"
	"fmt"
	//"os"
)


func serveSales(w http.ResponseWriter, req *http.Request) {
	fmt.Printf("serveSales\n")
	data, err := httputil.DumpRequest(req, false)
	if err != nil{
		log.Println("ERR=", err)
	}
	log.Println(string(data))

	content, _ := ioutil.ReadAll(req.Body)
	log.Println(string(content))
	io.WriteString(w, "DONE")
}

func main() {
	http.HandleFunc("/sales", serveSales)
	err := http.ListenAndServe(":12345", nil)
	if err != nil {
		log.Fatal("ListenAndServe: ", err)
	}
}